import java.util.HashSet;
import java.util.Set;

//test
public class SimpleComposition {
	
	public static void main(String args[]) {
		try {
			Set <Concept> concepts = new HashSet<Concept> ();
			Concept a = new Concept("A");
			concepts.add(a);
			Concept b = new Concept("B");
			concepts.add(b);
			Concept c = new Concept("C");
			concepts.add(c);
			Concept d = new Concept("D");
			concepts.add(d);
			Concept e = new Concept("E");
			concepts.add(e);
			Concept f = new Concept("F");
			concepts.add(f);
			Concept g = new Concept("G");
			concepts.add(g);
			Concept h = new Concept("H");
			concepts.add(h);
			Concept j = new Concept("J");
			concepts.add(j);
			Concept k = new Concept("K");
			concepts.add(k);
			
			Set <Service> services = new HashSet<Service> ();
			Service w1 = new Service("W1");
			w1.addInputConcept(a);
			w1.addInputConcept(b);
			w1.addInputConcept(c);
			w1.addOutputConcept(j);
			services.add(w1);
			
			Service w2 = new Service("W2");
			w2.addInputConcept(b);
			w2.addInputConcept(c);
			w2.addOutputConcept(e);
			w2.addOutputConcept(f);
			services.add(w2);
			
			Service w3 = new Service("W3");
			w3.addInputConcept(c);
			w3.addInputConcept(e);
			w3.addOutputConcept(h);
			services.add(w3);
			
			Service w4 = new Service("W4");
			w4.addInputConcept(c);
			w4.addInputConcept(f);
			w4.addOutputConcept(g);
			services.add(w4);
			
			Service w5 = new Service("W5");
			w5.addInputConcept(k);
			w5.addOutputConcept(h);
			services.add(w5);
			
			Service w6 = new Service("W6");
			w6.addInputConcept(j);
			w6.addOutputConcept(c);
			services.add(w6);
			
			Service w7 = new Service("W7");
			w7.addInputConcept(h);
			w7.addOutputConcept(d);
			services.add(w7);

			Service w8 = new Service("W8");
			w8.addInputConcept(g);
			w8.addOutputConcept(h);
			services.add(w8);
			
			PlanningGraph pg = new PlanningGraph();
			pg.goalSet.add(d);
			pg.givenSet.add(a);
			pg.givenSet.add(b);
			pg.givenSet.add(c);
			pg.GraphPlan(services);
		}
		catch(Exception e) {
			System.out.println(e.getStackTrace());
		}
		
	}

}
